package chapter6;

import variable.Array;

import java.sql.Time;
import java.util.Arrays;
import java.util.Date;
import java.util.Timer;

public class LambdaTest {

    public static void main(String[] args) {
        String[] planets = {"Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune"};
        System.out.println(Arrays.toString(planets));
        Arrays.sort(planets);
        System.out.println(Arrays.toString(planets));

        Arrays.sort(planets,(first,second) -> first.length() - second.length());
        System.out.println(planets);


    }
}
